package com.es.disped.dao.mapper;

import com.es.disped.dao.model.UserRoleRel;
import com.es.disped.dao.model.UserRoleRelExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface UserRoleRelMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=UserRoleRelSqlProvider.class, method="countByExample")
    long countByExample(UserRoleRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @DeleteProvider(type=UserRoleRelSqlProvider.class, method="deleteByExample")
    int deleteByExample(UserRoleRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Delete({
        "delete from user_role_rel",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Insert({
        "insert into user_role_rel (rel_id, user_id, ",
        "role_id)",
        "values (#{relId,jdbcType=CHAR}, #{userId,jdbcType=CHAR}, ",
        "#{roleId,jdbcType=CHAR})"
    })
    int insert(UserRoleRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @InsertProvider(type=UserRoleRelSqlProvider.class, method="insertSelective")
    int insertSelective(UserRoleRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=UserRoleRelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="role_id", property="roleId", jdbcType=JdbcType.CHAR)
    })
    List<UserRoleRel> selectByExample(UserRoleRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Select({
        "select",
        "rel_id, user_id, role_id",
        "from user_role_rel",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="role_id", property="roleId", jdbcType=JdbcType.CHAR)
    })
    UserRoleRel selectByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=UserRoleRelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") UserRoleRel record, @Param("example") UserRoleRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=UserRoleRelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") UserRoleRel record, @Param("example") UserRoleRelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=UserRoleRelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(UserRoleRel record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table user_role_rel
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update user_role_rel",
        "set user_id = #{userId,jdbcType=CHAR},",
          "role_id = #{roleId,jdbcType=CHAR}",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(UserRoleRel record);
}